# words=['cat','window','defenest']
# wordss=['sdf']
# for w in wordss :
#     print(w,len(w))
# Create a sample collection
# use存储字典的键值，status存储值
# users = {'Hans': 'active', 'Éléonore': 'inactive', '景太郎': 'active'}
# for use,status in users.copy().items():
#     if status == 'inactive' :
#         del users[use]
# print(users)
#
# active_users={}
# for use,status in users.items():
#     if status == 'active' :
#         active_users[use] = status
# print(active_users)
#
# for i in range(0, 7):
#     if i!=6:
#         print(i,end=' ')
#     else:
#         print(i)
#
# print(list(range(1,6)))
# for i in 10:
#     print(i)
# a = ['Mary', 'had', 'a', 'little', 'lamb']
# for i in range(len(a)):
#     print(i,a[i])
# print(type(range))
# a=10
# print(type(a))
# print(type(list))
# print(range(1,11))
# print(sum(range(1,5)))
# for n in range(2, 10):
#     for x in range(2, n):
#         if n % x == 0:
#             print(n, 'equals', x, '*', n//x)
#             break
#     else:
#         # loop fell through without finding a factor
#         print(n, 'is a prime number')
#

#
# def whers_is(point):
#     match point:
#         case Point(x=0, y=0):
#             print("Origin")
#         case Point(x=0, y=y):
#             print(f'y={ y }')
#         case Point(x=x, y=0):
#             print(f"X={x}")
#         case Point():
#             print("Somewhere else")
#         case _:
#             print("Not a point")

# class Myclass:
#     def __init__(self,x,y):
#         self.x=x
#         self.y=y
#         print(type(self))
#     def __str__(self):
#         return f"x={self.x},y={self.y}"
#
# obj1=Myclass(1,2)
# print(obj1)

#集合[]
# data=[1,2,3,4,5]
# match data:
#     case [x,y,z,*rest]:
#         print(f'x={x},y={y},z={z},rest={rest}')
#     case _:
#         print("no elements")
#
# data1=['1',45,23.5,46,'gyu']
# match data1:
#     case [x,y,z,*rest]:
#         print(f'x={x},y={y},z={z},rest={rest}')
#     case _:
#         print("no elements")


# data ={"aaa":1,"bbb":2,"ccc":3}
# match data:
#     case {"aaa":a,"bbb":b,**rest}:
#         print(f"aaaa:{a},bbb:{b},**rest:{rest}")
#     case _:
#         print("NO")

# class Point:
#     def __init__(self,x,y):
#         self.x = x
#         self.y = y
#
#     __match_args__ = ('x', 'y')
#
#
# data=(Point(1,2),Point(3,4))
# match data:
#     case (Point(x1, y1),Point(x2, y2) as p2):
#         print(f"First point: ({x1}, {y1})")
#         print(f"Second point: ({x2}, {y2})")
#         print(f"Second point object: {p2}")
#     case _:
#         print("NO")


# from enum import Enum
# class Color(Enum):
#     RED='red'
#     BLUE='blue'
#     GREEN='green'
#
# color = Color(input("Enter your choice of 'red', 'blue' or 'green': "))
# match Color:
#     case Color.RED:
#             print(f"Color.RED={Color.RED}")
#     case Color.BLUE:
#             print(f"Color.BLUE={Color.BLUE}")



def fib(n):    # write Fibonacci series up to n
    """Print a Fibonacci series up to n."""
    a, b = 0, 1
    while a < n:
        print(a, end=' ')
        a, b = b, a+b
    print()
fib(2000)
